package cn.edu.zut.soft.student.dao;

import cn.edu.zut.soft.student.model.Course;
import cn.edu.zut.soft.student.model.CourseExample;

import java.util.List;

import cn.edu.zut.soft.student.model.SelectCourseStudents;
import cn.edu.zut.soft.student.model.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

@Mapper
@Component
public interface CourseMapper {
    long countByExample(CourseExample example);

    int deleteByExample(CourseExample example);

    int deleteByPrimaryKey(String courseid);

    int insert(Course record);

    int insertSelective(Course record);

    List<Course> selectByExample(CourseExample example);

    Course selectByPrimaryKey(String courseid);

    int updateByExampleSelective(@Param("record") Course record, @Param("example") CourseExample example);

    int updateByExample(@Param("record") Course record, @Param("example") CourseExample example);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKey(Course record);

    //查询某个课程的所有学生
    List<Student> queryCourseStudentsByID(String courseid);

    //查询所有课程对应选课学生
    List<SelectCourseStudents> selectCourseStudents();
}